package com.qrpay.model.enums;

/**
 * 银行账户类型
 */
public enum BankAccountType {

    PublicAccount("PublicAccount", "对公账户"),
    PrivateAccount("PrivateAccount", "对私账户"),
    ;

    private final String code;
    private final String desc;

    BankAccountType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public boolean equals(String code) {
        return this.code.equals(code);
    }

    public static BankAccountType byCode(String code) {
        for (BankAccountType t : values()) {
            if (t.equals(code)) return t;
        }
        return null;
    }
}
